<template>
    <div>
        <div>
            编程式路由传参 this.$router.push
        </div>
        <div>
            <div>
                 <span>
                    命名路由传参
                </span>
                <el-button @click="routerTo">点击去新页面params</el-button>
            </div>
            <div>
                <span>查询传参</span>
                <el-button @click="routerTo1">点击去新页面query</el-button>
            </div>
        </div>
    </div>
</template>
<script>
export default {
  name: "routerProp",
  methods: {
    routerTo() {
      this.$router.push({ name: "receiveParam", params: { userId: 1 } });
    },
    routerTo1() {
      this.$router.push({ path: "/receiveParam", query: { userId: 1 } });
    },
  }
};
</script>
